/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author CristianR cristianemilio14@gmail.com
 */
@Entity
@Table(name = "producto")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Producto.findAll", query = "SELECT p FROM Producto p")})
public class Producto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "idprov")
    private int idprov;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @Column(name = "descripcion")
    private String descripcion;
    @Basic(optional = false)
    @Column(name = "cant")
    private int cant;
    @Basic(optional = false)
    @Column(name = "stockmin")
    private int stockmin;
    @Basic(optional = false)
    @Column(name = "stockmax")
    private int stockmax;
    @Basic(optional = false)
    @Column(name = "preciocomp")
    private double preciocomp;
    @Basic(optional = false)
    @Column(name = "preciovent")
    private double preciovent;
    @Basic(optional = false)
    @Column(name = "uninum")
    private int uninum;
    @Basic(optional = false)
    @Column(name = "unimed")
    private String unimed;
    @Basic(optional = false)
    @Column(name = "estado")
    private int estado;

    public Producto() {
    }

    public Producto(Integer id) {
        this.id = id;
    }

    public Producto(Integer id, int idprov, String nombre, String descripcion, int cant, int stockmin, int stockmax, double preciocomp, double preciovent, int uninum, String unimed, int estado) {
        this.id = id;
        this.idprov = idprov;
        this.nombre = nombre;
        this.descripcion = descripcion;
        this.cant = cant;
        this.stockmin = stockmin;
        this.stockmax = stockmax;
        this.preciocomp = preciocomp;
        this.preciovent = preciovent;
        this.uninum = uninum;
        this.unimed = unimed;
        this.estado = estado;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getIdprov() {
        return idprov;
    }

    public void setIdprov(int idprov) {
        this.idprov = idprov;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public int getCant() {
        return cant;
    }

    public void setCant(int cant) {
        this.cant = cant;
    }

    public int getStockmin() {
        return stockmin;
    }

    public void setStockmin(int stockmin) {
        this.stockmin = stockmin;
    }

    public int getStockmax() {
        return stockmax;
    }

    public void setStockmax(int stockmax) {
        this.stockmax = stockmax;
    }

    public double getPreciocomp() {
        return preciocomp;
    }

    public void setPreciocomp(double preciocomp) {
        this.preciocomp = preciocomp;
    }

    public double getPreciovent() {
        return preciovent;
    }

    public void setPreciovent(double preciovent) {
        this.preciovent = preciovent;
    }

    public int getUninum() {
        return uninum;
    }

    public void setUninum(int uninum) {
        this.uninum = uninum;
    }

    public String getUnimed() {
        return unimed;
    }

    public void setUnimed(String unimed) {
        this.unimed = unimed;
    }

    public int getEstado() {
        return estado;
    }

    public void setEstado(int estado) {
        this.estado = estado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Producto)) {
            return false;
        }
        Producto other = (Producto) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.Producto[ id=" + id + " ]";
    }
    
}
